package com.moduleSys.web;

import com.moduleSys.entity.system.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 *
 * @author czw
 * @date 2017/6/30 0030
 */
@RestController
public class WebController {
    private static final Logger logger = LoggerFactory.getLogger(WebController.class);

    @RequestMapping(value = "/backstage/{page}/{index}", method = {RequestMethod.GET, RequestMethod.POST})
    public ModelAndView page(@PathVariable("page") String page,@PathVariable("index") String index) {
        return new ModelAndView("/backstage/"+page+"/"+index);
    }

    @RequestMapping(value = "/backstage/{page}", method = {RequestMethod.GET, RequestMethod.POST})
    public ModelAndView pages(@PathVariable("page") String page) {
        return new ModelAndView("/backstage/"+page);
    }
    @RequestMapping(value = "/{page}", method = {RequestMethod.GET, RequestMethod.POST})
    public ModelAndView index(@PathVariable("page") String page) {
        return new ModelAndView("/"+page);
    }
    @RequestMapping(value = "/admin/login",method = {RequestMethod.GET,RequestMethod.POST})
    public ModelAndView adminIndex(){
        return new ModelAndView("/login");
    }
}
